package com.demo.service.impl;

import com.demo.dao.IGoodsDao;
import com.demo.entity.Goods;
import com.demo.entity.User;
import com.demo.service.IGoodsService;
import com.demo.vo.GoodsVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements IGoodsService {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private IGoodsDao dataDao;

    @Override
    public List<Goods> queryByPage(GoodsVo user) {
        return dataDao.queryByPage(user);
    }


    @Override
    public int deleteByPrimaryKey(Integer id) {
        return dataDao.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Goods record) {
        return dataDao.insert(record);
    }

    @Override
    public int insertSelective(Goods record) {
        return dataDao.insertSelective(record);
    }

    @Override
    public Goods selectByPrimaryKey(Integer id) {
        return dataDao.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Goods record) {
        return dataDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<Goods> queryGoodsCategory(GoodsVo user) {
        return dataDao.queryGoodsCategory(user);
    }

    @Override
    public List<Goods> selectByIds(List<String> ids) {
        return dataDao.selectByIds(ids);
    }

    @Override
    public List<User> queryGoodsQQ() {
        String operateIds = dataDao.queryGoodsOperator();
        List<String> operateIds_ = java.util.Arrays.asList(operateIds.split(","));
        return dataDao.queryGoodsOperatorQQ(operateIds_);
    }

    @Override
    public int isOperator(Goods user) {
        return dataDao.isOperator(user);
    }


    @Override
    public int queryCount(GoodsVo user) {
        return dataDao.queryCount(user);
    }
}
